package com.dao;

import com.bean.Building;
import com.dao.BuildingDAO;
import com.util.C3p0Utils;
import org.apache.commons.dbutils.handlers.BeanHandler;
import org.apache.commons.dbutils.handlers.BeanListHandler;
import org.apache.commons.dbutils.handlers.ScalarHandler;

import java.sql.SQLException;
import java.util.List;

public interface BuildingDAO {

 /**
  * BeanListHandler将结果列表封装
  * @return
  * @throws SQLException
  */
 public List<Building> selectAll() throws SQLException;
 /**
  * BeanHandler将单个列表封装
  * @param id
  * @return
  * @throws SQLException
  */
  Building selectById(Integer id) throws SQLException;

  boolean deleteById(Integer id) throws SQLException ;

  boolean deleteAll(String[] idsArr) throws SQLException ;

  boolean insert(Building b) throws SQLException ;

  boolean update(Building b) throws SQLException ;

 /**
  * ScalarHandler用来将单个Object类型封装
  * @return
  * @throws SQLException
  */
  Integer count() throws SQLException ;

  Integer countSearch(String search) throws SQLException ;

  List<Building> selectAllPagination(Integer offset, Integer limit) throws SQLException ;

  List<Building> selectAllPaginationSearch(Integer offset, Integer limit, String search) throws SQLException;




}
